package com.alphathink.deliveryassist.util;

import android.app.Activity;
import android.util.DisplayMetrics;
import android.util.Log;

/***
 * 屏幕适配 当每一英寸160点的显示器上　1dp=1px
 * 
 * @ClassName: ScreenAdapter
 * @Description: TODO
 * @author alphathink xpg
 * @date 2015-4-27 上午9:44:58
 * 
 */
public class ScreenAdapter {
	private static final DisplayMetrics displayMetrics = new DisplayMetrics();
	private int mWindthPx, mHeightPx;

	public int getmWindthPx() {
		return mWindthPx;
	}

	public void setmWindthPx(int mWindthPx) {
	}

	/**
	 * 返回值为屏幕的高度像素为单位
	 */
	public int getmHeightPx() {
		return mHeightPx;
	}

	public void setmHeightPx(int mHeightPx) {
		this.mHeightPx = displayMetrics.heightPixels;
	}

	public ScreenAdapter(Activity activity) {
		activity.getWindowManager().getDefaultDisplay()
				.getMetrics(displayMetrics);
		this.mHeightPx = displayMetrics.heightPixels;
		this.mWindthPx = displayMetrics.widthPixels;
		Log.d("adapter", String.valueOf(displayMetrics.heightPixels));
		Log.d("adapter", String.valueOf(displayMetrics.widthPixels));
	}

}
